<style>
  @import '../../assets/css/order.css';
</style>
<template>
	<div class="m-content">
		<AppHeader></AppHeader>
		<div class="warp">
			<div class="m-middle">
				<div class="m-order-tab f-cb">
					<ul>
						<li class="m-act">专家审核</li>
					</ul>
				</div>
			</div>
			<div class="m-table f-cb">
				<div class="m-nav">
					<ul>
						<div class="m-nav-menu">
							<li v-on:click="getList(0)" v-bind:class="{'m-nav-title':0==index}">待审核订单</li>
							<li v-on:click="getList(1)" v-bind:class="{'m-nav-title':1==index}">已审核订单</li>
						</div>
					</ul>
				</div>
				<table class="m-table-content">
					<tr>
						<th>订单编号</th>
						<th>购买服务</th>
						<th>状态</th>
						<th>操作</th>
					</tr>
					<tr v-for="list in list">
						<td>{{ list.serviceId }}</td>
						<td>志愿填报服务</td>
						<td v-if="index==0">待审核订单</td>
						<td v-else-if="index==1">已审核订单</td>
						<td><span v-if="index==0"><span v-if="list.address == '江苏'"><router-link :to="{ name: 'jsdetails', query: { id: list.serviceId,'selected':'2' }}" class="t-btn">订单详情 →</router-link></span>
						<span v-else-if="list.address == '浙江'"><router-link :to="{ name: 'zjdetails', query: { id: list.serviceId,'selected':'2' }}" class="t-btn">订单详情 →</router-link></span>
						<span v-else-if="list.address == '上海'"><router-link :to="{ name: 'shdetails', query: { id: list.serviceId ,'selected':'2'}}" class="t-btn">订单详情 →</router-link></span>
						<span v-else ><router-link :to="{ name: 'details', query: { id: list.serviceId,'selected':'2' }}" class="t-btn">订单详情 →</router-link></span></span>
						<span v-if="index==1"><span v-if="list.address == '江苏'"><router-link :to="{ name: 'jsdetails', query: { id: list.serviceId,'selected':'3' }}" class="t-btn">订单详情 →</router-link></span>
						<span v-else-if="list.address == '浙江'"><router-link :to="{ name: 'zjdetails', query: { id: list.serviceId,'selected':'3' }}" class="t-btn">订单详情 →</router-link></span>
						<span v-else-if="list.address == '上海'"><router-link :to="{ name: 'shdetails', query: { id: list.serviceId ,'selected':'3'}}" class="t-btn">订单详情 →</router-link></span>
						<span v-else ><router-link :to="{ name: 'details', query: { id: list.serviceId,'selected':'3' }}" class="t-btn">订单详情 →</router-link></span></span>
						</td>						
					</tr>							
				</table>
			</div>
		</div>	
		<Footer></Footer>		
	</div>
</template>
<script>
	import { MessageBox } from 'element-ui';
	import AppHeader from '@/components/Header';
	import Footer from '@/components/Footer';
	export default {
	  	name: 'ucenter',
		components: {
		  AppHeader,
		  Footer, 
		},
		data(){
			return{
				isShow: false,
				getAll:[],
				list:[],	
				index :'0',			
			}
		},
		created(){
			var that = this;
			this.getList(0)
		},
		methods: {
			getList:function(serviceId){
				var that = this;
				that.index = serviceId;
				this.axios.get('/yan-web/order/volunteersLeader/order',{params:{'status':serviceId,'pageSize':'100'}},{
				    headers: {
				          'Content-type': 'application/json;charset=UTF-8'
				    }
				})
				.then(function (response) {
					if(response.data.status){
						that.list = response.data.model.rows;		
					}else{			
						that.$router.push({ path: '/login' });
						that.clearCookie();	
					}
				})
			},		
		}
	}	
</script>


